"""
__author__ = '霍格沃兹测试开发学社'
__desc__ = '更多测试开发技术探讨，请访问：https://ceshiren.com/t/topic/15860'
"""
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait

from web_practice.prepare.web_po.page.base_page import BasePage


class ContactPage(BasePage):
    __TEXT_TIPS = (By.ID, "js_tips")

    def get_tips(self):
        # 获取 提示信息
        # 4. 断言结果
        # loc_tips = (By.ID, "js_tips")
        # 等到可见，再去获取结果文字
        self.wait_visible(self.__TEXT_TIPS)
        # WebDriverWait(self.driver, 10, 2).until(expected_conditions.visibility_of_element_located(loc_tips))
        tips_value = self.do_find(self.__TEXT_TIPS).text
        return tips_value
